import React from 'react'
import StateShow from './StateShow';
import StateUpdate from './StateUpdate';
import store from '../../redux/store';
import { increAction } from '../../redux/reducers/zanReducer';

export default function ReduxCom() {
  return (
    <div>
      <StateShow />
      <StateUpdate />
      <hr />
      <h2>点赞数: {store.getState().zan}</h2>
      <button onClick={() => {
        store.dispatch(increAction());
      }}>点赞</button>
    </div>
  )
}
